Skip to content

fix: skip duplicate "Add to topics" commit on repeated submissions#88

Open
raghav-potdar wants to merge 1 commit into
raphaelheinz:mainfrom
raghav-potdar:fix-extra-commit-for-repeat-submission
Open

fix: skip duplicate "Add to topics" commit on repeated submissions#88
raghav-potdar wants to merge 1 commit into
raphaelheinz:mainfrom
raghav-potdar:fix-extra-commit-for-repeat-submission

Conversation

@raghav-potdar

Copy link
Copy Markdown

Problem

When a LeetCode solution is submitted multiple times (e.g. resubmitting an already-accepted problem), LeetHub creates an extra git commit with the message Add to topics. on every submission — even though the problem was already present in the README topic tables and nothing actually changed.

Blank extra commit on every submission
image

Fix

Snapshot the README content before the append loop. After the loop — but before calling sortTopicsInReadme — compare the result to the snapshot. If the content is identical (nothing new was added), exit early and skip both sorting and uploading entirely.

… topics if topic it's already present. Avoiding one extra commit on multiple submission for same problem
@raghav-potdar

Copy link
Copy Markdown
Author

This PR partly resolves Issue #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant